'use strict';

module.exports = app => {
  const { STRING, DATE, UUIDV4, UUID } = app.Sequelize;

  const Members = app.model.define('members', {
     name: {
        type: STRING(64),
        comment: '用户名',
        allowNull: false,
      },
      password: {
        type: STRING,
        comment: '密码'
      },
      age: {
        type: STRING(3),
        comment: '年龄',
        allowNull: true,
      },
      gender: {
        type: STRING(1),
        defaultValue: 'F',
        comment: '性别',
        allowNull: true,
      },
      province_code: {
        type: STRING(8),
        allowNull: true,
        comment: '省-code'
      },
      city_code: {
        type: STRING(8),
        allowNull: true,
        comment: '市-code'
      },
      county_code: {
        type: STRING(8),
        allowNull: true,
        comment: '区-code'
      },
      address: {
        type: STRING(128),
        allowNull: true,
        comment: '地址'
      },
      uuid: {
        type: UUID,
        defaultValue: UUIDV4,
        primaryKey: true
      },
      created_at: DATE,
      updated_at: DATE
  });

  return Members;
};
